ace.define("ace/ext/whitespace",["require","exports","module","ace/lib/lang"],function(e,t,n){var r=e("../lib/lang");t.$detectIndentation=function(e,t){function n(e){for(var t=0,n=e;n<r.length;n+=e)t+=r[n]||0;return t}for(var r=[],a=[],i=0,s=0,c=Math.min(e.length,1e3),o=0;c>o;o++){var g=e[o];if(/^\s*[^*+\-\s]/.test(g)){var h=g.match(/^\t*/)[0].length;"	"==g[0]&&i++;var l=g.match(/^ */)[0].length;if(l&&"	"!=g[l]){var f=l-s;f>0&&!(s%f)&&!(l%f)&&(a[f]=(a[f]||0)+1),r[l]=(r[l]||0)+1}for(s=l;c>o&&"\\"==g[g.length-1];)g=e[o++]}}if(r.length){for(var v=a.reduce(function(e,t){return e+t},0),u={score:0,length:0},d=0,o=1;12>o;o++){if(1==o){d=n(o);var m=1}else var m=n(o)/d;a[o]&&(m+=a[o]/v),m>u.score&&(u={score:m,length:o})}if(u.score&&u.score>1.4)var p=u.length;return i>d+1?{ch:"	",length:p}:d+1>i?{ch:" ",length:p}:void 0}},t.detectIndentation=function(e){var n=e.getLines(0,1e3),r=t.$detectIndentation(n)||{};return r.ch&&e.setUseSoftTabs(" "==r.ch),r.length&&e.setTabSize(r.length),r},t.trimTrailingSpace=function(e,t){for(var n=e.getDocument(),r=n.getAllLines(),a=t?-1:0,i=0,s=r.length;s>i;i++){var c=r[i],o=c.search(/\s+$/);o>a&&n.removeInLine(i,o,c.length)}},t.convertIndentation=function(e,t,n){var a=e.getTabString()[0],i=e.getTabSize();n||(n=i),t||(t=a);for(var s="	"==t?t:r.stringRepeat(t,n),c=e.doc,o=c.getAllLines(),g={},h={},l=0,f=o.length;f>l;l++){var v=o[l],u=v.match(/^\s*/)[0];if(u){var d=e.$getStringScreenWidth(u)[0],m=Math.floor(d/i),p=d%i,S=g[m]||(g[m]=r.stringRepeat(s,m));S+=h[p]||(h[p]=r.stringRepeat(" ",p)),S!=u&&(c.removeInLine(l,0,u.length),c.insertInLine({row:l,column:0},S))}}e.setTabSize(n),e.setUseSoftTabs(" "==t)},t.$parseStringArg=function(e){var t={};/t/.test(e)?t.ch="	":/s/.test(e)&&(t.ch=" ");var n=e.match(/\d+/);return n&&(t.length=parseInt(n[0],10)),t},t.$parseArg=function(e){return e?"string"==typeof e?t.$parseStringArg(e):"string"==typeof e.text?t.$parseStringArg(e.text):e:{}},t.commands=[{name:"detectIndentation",exec:function(e){t.detectIndentation(e.session)}},{name:"trimTrailingSpace",exec:function(e){t.trimTrailingSpace(e.session)}},{name:"convertIndentation",exec:function(e,n){var r=t.$parseArg(n);t.convertIndentation(e.session,r.ch,r.length)}},{name:"setIndentation",exec:function(e,n){var r=t.$parseArg(n);r.length&&e.session.setTabSize(r.length),r.ch&&e.session.setUseSoftTabs(" "==r.ch)}}]}),function(){ace.require(["ace/ext/whitespace"],function(){})}();